<?php
namespace addon\wechat_config\controller;

use app\common\controller\AddonAdminBase;
use app\common\controller\AddonFrontBase;
use tpfcore\Core;

/**
*	获取微信相关参数接口类
*/
class Wechat extends AddonFrontBase
{
	/*
		获取jsapi所须参数
	*/
    public function getJsapiParam(){
    	header("Access-Control-Allow-Origin: * ");
		header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE");
		header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept,Access-Token,Timestamp");
        $this->jump(Core::loadAddonModel("WechatConfig")->getJsapiParam($this->param));
    }
    /*
    	获取用户信息
    */
    public function getUserInfo(){
    	$this->jump(Core::loadAddonModel($this->name)->getUserInfo($this->param));
    }
    /*
    	获取带参数的二维码
    */
    public function getExtendQrcode(){
        header("Access-Control-Allow-Origin: * ");
        header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE");
        header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept,Access-Token,Timestamp");
    	$this->jump(Core::loadAddonModel($this->name)->getExtendQrcode($this->param));
    }
}
